{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "read_sas column limit\n",
      "    number                                              title  \\\n",
      "0    24794                              read_sas column limit   \n",
      "1    24793  Avoid unnecessary use of _coerce_scalar_to_tim...   \n",
      "2    24790  Bug: plot.bar() plots very incorrect values fo...   \n",
      "3    24789             Crosstab Preserves Dtypes release note   \n",
      "4    24788  Timestamp.strftime() has erratic behavior afte...   \n",
      "5    24787  How to force pandas to display all columns on ...   \n",
      "6    24786  df.groupby(df.index) drops index info when df ...   \n",
      "7    24784                            Locators off by one day   \n",
      "8    24783  Single-level tuple index to multi-level index ...   \n",
      "9    24782  BUG: DataFrame.merge(suffixes=) does not respe...   \n",
      "10   24779               python-project-packaging-with-pandas   \n",
      "11   24778  Python crash with segmentation failure upon im...   \n",
      "12   24775                BUG: timedelta64 + Timestamp raises   \n",
      "13   24773                    ExtensionArray.astype docstring   \n",
      "14   24769             REF/TST: Stop using singleton fixtures   \n",
      "15   24768  Concatenating rows with Int64 datatype coerces...   \n",
      "16   24767  The feather example from docs segfault with py...   \n",
      "17   24766        read_html ignores paragraphs in table cells   \n",
      "18   24763              Format mismatch doesn't coerce to NaT   \n",
      "19   24762                           DOC: update DF.set_index   \n",
      "20   24757  implement+test mean for datetimelike EA/Index/...   \n",
      "21   24753     [0.24.0rc1] passing dtype='M8' to Index raises   \n",
      "22   24752  DataFrame.mean includes datetime64[ns] dtypes ...   \n",
      "23   24749                       Split test_excel.py (#24472)   \n",
      "24   24748  ENH / RFC Only apply first row once in fast apply   \n",
      "25   24742  23 seems to be the new 42: exception if concat...   \n",
      "26   24740     Exception when grouping on a modified category   \n",
      "27   24739  0.24.0rc1: infer_dtype(DatetimeIndex) returns ...   \n",
      "28   24737  PERF: leverage tzlocal package to provide 2000...   \n",
      "29   24736  TST: add  coverage of DST transition for DateT...   \n",
      "\n",
      "                                               labels state  \n",
      "0                                                  []  open  \n",
      "1                                                  []  open  \n",
      "2   [{'id': 2413328, 'node_id': 'MDU6TGFiZWwyNDEzM...  open  \n",
      "3   [{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...  open  \n",
      "4   [{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...  open  \n",
      "5                                                  []  open  \n",
      "6                                                  []  open  \n",
      "7                                                  []  open  \n",
      "8                                                  []  open  \n",
      "9   [{'id': 76811, 'node_id': 'MDU6TGFiZWw3NjgxMQ=...  open  \n",
      "10                                                 []  open  \n",
      "11  [{'id': 307649777, 'node_id': 'MDU6TGFiZWwzMDc...  open  \n",
      "12  [{'id': 47223669, 'node_id': 'MDU6TGFiZWw0NzIy...  open  \n",
      "13  [{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...  open  \n",
      "14  [{'id': 211029535, 'node_id': 'MDU6TGFiZWwyMTE...  open  \n",
      "15  [{'id': 195647922, 'node_id': 'MDU6TGFiZWwxOTU...  open  \n",
      "16  [{'id': 76865106, 'node_id': 'MDU6TGFiZWw3Njg2...  open  \n",
      "17  [{'id': 57395487, 'node_id': 'MDU6TGFiZWw1NzM5...  open  \n",
      "18  [{'id': 76811, 'node_id': 'MDU6TGFiZWw3NjgxMQ=...  open  \n",
      "19  [{'id': 134699, 'node_id': 'MDU6TGFiZWwxMzQ2OT...  open  \n",
      "20  [{'id': 57296398, 'node_id': 'MDU6TGFiZWw1NzI5...  open  \n",
      "21  [{'id': 31404521, 'node_id': 'MDU6TGFiZWwzMTQw...  open  \n",
      "22  [{'id': 47223669, 'node_id': 'MDU6TGFiZWw0NzIy...  open  \n",
      "23  [{'id': 211029535, 'node_id': 'MDU6TGFiZWwyMTE...  open  \n",
      "24  [{'id': 233160, 'node_id': 'MDU6TGFiZWwyMzMxNj...  open  \n",
      "25  [{'id': 307649777, 'node_id': 'MDU6TGFiZWwzMDc...  open  \n",
      "26  [{'id': 76811, 'node_id': 'MDU6TGFiZWw3NjgxMQ=...  open  \n",
      "27  [{'id': 31404521, 'node_id': 'MDU6TGFiZWwzMTQw...  open  \n",
      "28  [{'id': 8935311, 'node_id': 'MDU6TGFiZWw4OTM1M...  open  \n",
      "29  [{'id': 127685, 'node_id': 'MDU6TGFiZWwxMjc2OD...  open  \n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import pandas as pd\n",
    "\n",
    "url = 'https://api.github.com/repos/pandas-dev/pandas/issues'\n",
    "\n",
    "# 我们可以发一个HTTP GET请求，使用requests扩展库：\n",
    "resp = requests.get(url);\n",
    "\n",
    "# 响应对象的json方法会返回一个包含被解析过的JSON字典，加载到一个Python对象中：\n",
    "data = resp.json();\n",
    "\n",
    "title = data[0]['title']\n",
    "\n",
    "print(title)\n",
    "\n",
    "# data中的每个元素都是一个包含所有GitHub主题页数据（不包含评论）的字典。我们可以直接传递数据到DataFrame，并提取感兴趣的字段：\n",
    "\n",
    "issues = pd.DataFrame(data, columns=['number', 'title', 'labels', 'state'])\n",
    "print(issues);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
